function [maxHeight, sub_triangle]=findTriangles(p1, p2, triangles, sites)

numSites=size(sites,1);
theSites=[];

for s=1:numSites
    if sum(sites(s,1:2)<max(p1(1,1:2), p2(1,1:2)))==2
        if sum(sites(s,1:2)>min(p1(1,1:2), p2(1,1:2)))==2
            theSites=[theSites; s];
        end
    end
end

heights=sites(theSites, 3);
maxHeight=max(heights);

numTriangles=size(triangles,1);
sub_triangle=[];

for t=1:numTriangles
    if ~isempty(intersect(triangles(t,:), theSites))
        sub_triangle=[sub_triangle; t];
    end
end